#ifndef _BCESDK_API_H
#define _BCESDK_API_H
#include "BCESDK_Macro.h"
#include "BCESDK_Stru.h"
//-------------------------------------------------------------------
// you should not define CESDK_EXPORTS in client project
//-------------------------------------------------------------------
#ifdef BCESDK_EXPORTS
#define CESDK_API __declspec(dllexport)
#else
#define CESDK_API __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif

//basic
	CESDK_API long BCESDK_Init();
	CESDK_API long BCESDK_InitEx(BCESDK_CbkFunc *pFunc);
	CESDK_API long BCESDK_BTDeviceUnplug();
	CESDK_API long BCESDK_UnInit();

	CESDK_API long BCESDK_GetSofewareVersion(/*out*/wchar_t *name);

	CESDK_API long BCESDK_GetLocalName(/* out */ wchar_t* name,/* in */unsigned int len);
	CESDK_API long BCESDK_SetLocalName( /* in */ wchar_t* name);
	CESDK_API long BCESDK_GetDefaultPinCode(/* out */ char* pincode, /* in/out */ unsigned int *plen);
	CESDK_API long BCESDK_SetDefaultPinCode( /* in */ char* pincode, /* in */ unsigned int len);
    CESDK_API long BCESDK_GetLocalBTAddr(/* out */unsigned char* bd_addr);

	CESDK_API long BCESDK_GetRemoteServices(/* in */ unsigned char *bd_addr, /* out */ PBCESDK_RemoteServiceAttrStru pServiceAttrStru, /* in/out */ unsigned int  *svc_count);
	CESDK_API long BCESDK_GetRemoteName(/* in */ unsigned char *bd_addr, /* out */wchar_t *name);
	CESDK_API long BCESDK_DeviceDiscovery( /* in */ BCESDK_DeviceDiscovery_CbkFunc *pDeviceDiscovery_CbkFunc );
	CESDK_API long BCESDK_StopDiscovery();
	CESDK_API long BCESDK_RegisterConnectCallback( /* in */ BCESDK_DeviceConnect_CbkFunc *pDeviceConnect_CbkFunc );
	CESDK_API long BCESDK_RegisterPairCallback( /* in */ BCESDK_DevicePair_CbkFunc *pDevicePair_CbkFunc );
	CESDK_API void BCESDK_SetPairable(bool bPairable);
	CESDK_API void BCESDK_SetDiscoverable(bool bDiscoverable);
	CESDK_API void BCESDK_SetConnectable(bool bConnectable);
	CESDK_API long BCESDK_PairDevice( /* in */ unsigned char *bd_addr );
	CESDK_API long BCESDK_UnPairDevice( /* in */unsigned char*bd_addr );
	CESDK_API bool BCESDK_IsPairDevice( /* in */ unsigned char *bd_addr );

	CESDK_API long BCESDK_Connect( /* in */ unsigned char* bd_addr, /* in */ short svc_class );
	CESDK_API long BCESDK_ConnectEx( /* in */ unsigned char* bd_addr, /* in */ short svc_class,  /* in */ LPVOID lParameter);
	CESDK_API long BCESDK_Disconnect( /* in */ unsigned char* bd_addr, /* int */ short svc_class );
	CESDK_API bool BCESDK_IsConnected( /* in */ unsigned char* bd_addr, /* int */ short svc_class );
	CESDK_API long BCESDK_GetAllShortCuts(/* out */PBCESDK_ShortcutInfoStru pShortcutList, /* in/out */unsigned int *pListCount);
	CESDK_API long BCESDK_DeleteShortCut(/* in */unsigned char* bd_addr);

	CESDK_API void BCESDK_EnableAutoConnectHF();
    CESDK_API void BCESDK_DisableAutoConnectHF();
	CESDK_API bool BCESDK_IsAutoConnectHF();
	CESDK_API long BCESDK_GetModuleString(/* out */wchar_t *szModuleString);

//handfree
	CESDK_API long BCESDK_HFAP_RegisterCallback(/* in */HWND hWndReceive,/* in */BCESDK_HandsFree_CbkFunc *pHandsFree_CbFunc);
	CESDK_API long BCESDK_HFAP_AnswerCall();
	CESDK_API long BCESDK_HFAP_CancelCall();
	CESDK_API long BCESDK_HFAP_Dial(/* in */char* phone_num, /* in */unsigned int len);
	CESDK_API long BCESDK_HFAP_LastNumRedial();
	CESDK_API long BCESDK_HFAP_TransmitDTMFCode(/* in */char chr);
	CESDK_API long BCESDK_HFAP_GetAudioStatus();
	CESDK_API long BCESDK_HFAP_Transfer();
	CESDK_API long BCESDK_HFAP_TransferBack();
	CESDK_API void BCESDK_HFAP_MuteMic();
	CESDK_API void BCESDK_HFAP_UnmuteMic();

	CESDK_API long BCESDK_BindA2DPToHF();
	CESDK_API long BCESDK_UnbindA2DPFromHF();

	CESDK_API void BCESDK_EnableAutoAnswer();
	CESDK_API void BCESDK_DisableAutoAnswer();
	CESDK_API bool BCESDK_IsAutoAnswer();

//PIM
	CESDK_API long BCESDK_PIMRegisterCallback( /* in */ BCESDK_PIMUpdateResult_CbFunc *pUadateResult_CbFunc);
	CESDK_API long BCESDK_PIMGetOppContacts( /* out */PBCESDK_OPPPerson pOppperson, unsigned int *pCount);
	CESDK_API long BCESDK_PIMStartUpdateContacts( /* in */ PBCESDK_PhoneInfo pPhoneInfo);
	CESDK_API long BCESDK_PIMGetContacts( /* out */PBCESDK_ContactInfo pContacts, /* in/out */unsigned int *pCount);
	CESDK_API long BCESDK_PIMStartUpdateCalllog();
	CESDK_API long BCESDK_PIMGetCalllogs(/* out */PBCESDK_CalllogInfo pCalllogs, /* in/out */unsigned int *pCount);
	CESDK_API long BCESDK_GetPhoneList(/* out */PBCESDK_PhoneInfo pPhoneList, /* in/out */unsigned int *pListCount);

//A2DP&AVRCP
	CESDK_API long BCESDK_EnalbeA2DP();
	CESDK_API long BCESDK_DisableA2DP();
	CESDK_API bool BCESDK_IsA2DPEnable();
	CESDK_API void BCESDK_A2DP_SNK_EnablePlay( ); //UnMute A2DP snk
	CESDK_API void BCESDK_A2DP_SNK_DisablePlay( ); //Mute A2DP snk

	CESDK_API long BCESDK_AVRCPPlay( );
	CESDK_API long BCESDK_AVRCPPause( );
	CESDK_API long BCESDK_AVRCPStop( );
	CESDK_API long BCESDK_AVRCPForcePlay( );
	CESDK_API long BCESDK_AVRCPForcePause( );
	CESDK_API long BCESDK_AVRCPPlayLast( );
	CESDK_API long BCESDK_AVRCPPlayNext( );
	CESDK_API long BCESDK_AVRCPVolumeUP( );
	CESDK_API long BCESDK_AVRCPVolumeDown( );

	CESDK_API long BCESDK_RegPassThrCmdCbk(/* in */BCESDK_PassThrCmdCbFunc *pFunc);//use for a2dp src


//DUN
	CESDK_API long BCESDK_DUNGetCountry(/* out */PBCESDK_DunCountryInfo pCountry, /* in/out */unsigned int *pCount);
	CESDK_API long BCESDK_DUNGetProvider( /* in */unsigned int nCountryId,/* out */PBCESDK_DunProviderInfo pProvider,/* in/out */unsigned int *pCount);

//SPP
	CESDK_API int  BCESDK_GetClientPort();

//FTP
	CESDK_API long BCESDK_FTPGetRemoteFileList(/* in */wchar_t *path,/* in */BCESDK_FTP_UIShowBrowseFile *BrowFileListCallBackFun,/* in */unsigned int op_type);
 	CESDK_API long BCESDK_FTPDownLoadFile(/* in */wchar_t *rmt_file,/* in */wchar_t *new_file);
	CESDK_API long BCESDK_FTPDownLoadDir(/* in */wchar_t *rmt_dir,/* in */wchar_t *new_dir);
    CESDK_API long BCESDK_FTPPutFile(/* in */wchar_t *Loc_file,/* in */wchar_t *new_file);
	CESDK_API long BCESDK_FTPPutDir(/* in */wchar_t *loc_dir,/* in */wchar_t *new_dir);
 	CESDK_API long BCESDK_FTPNewFolder(/* in */wchar_t *new_dir);
    CESDK_API long BCESDK_FTPDeleteFile(/* in */wchar_t *szFile);
    CESDK_API long BCESDK_FTPDeleteDir(/* in */wchar_t *szDir);
    CESDK_API long BCESDK_FTPSetRmtDir(/* in */wchar_t *szDir);
	CESDK_API long BCESDK_FTPGetRmtDir(/* out */wchar_t *szDir);
    CESDK_API long BCESDK_FTPCancelTransfer();
	CESDK_API void BCESDK_FTPRegisterStatusCallback( /* in */BCESDK_FTP_STATUS_INFO_CB *func);
	CESDK_API long BCESDK_GetDefaultPath(/* out */ wchar_t* d_path);
	CESDK_API long BCESDK_SetDefaultPath( /* in */ wchar_t* d_path);

//OPP
	CESDK_API long BCESDK_OPPPushContact( /* in */unsigned char *bd_addr, /* in */PBCESDK_ContactInfo Contact);

	CESDK_API long BCESDK_GetSavePath(/* out */ wchar_t* szPath);
	CESDK_API long BCESDK_GetLastConnectedHFDevice(unsigned char* bd_addr);
	CESDK_API long BCESDK_GetLastConnectedAVDevice(unsigned char* bd_addr);
#ifdef __cplusplus
}
#endif


#endif